import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView,
    },
    {
      path: '/zhuce',
      name: 'zhuce',
      component: () => import('../views/zdc.vue'),
    },

    {
      path: '/123',
      name: '123',
      component: () => import('../views/zdc.vue'),
    },
    {
      path: '/calculator',
      name: 'calculator',
      component: () => import('../views/CalculatorView.vue'),
    },
    {
      path: '/tetris',
      name: 'tetris',
      component: () => import('../views/TetrisView.vue'),
    },
    {
      path: '/register',
      name: 'register',
      component: () => import('../views/RegisterView.vue'),
    },
    {
      path: '/login', // 新增登录页面路由
      name: 'login',
      component: () => import('../views/LoginView.vue'), // 引用新创建的组件
    },
    {
      path: '/register-success', // 新增注册成功页面路由
      name: 'register-success',
      component: () => import('../views/RegisterSuccessView.vue'), // 引用新创建的组件
    },
    {
      path: '/aboutme',
      name: 'aboutme',
      component: () => import('../views/AboutMeView.vue')
    },
    {
      path: '/update',
      name: 'update',
      component: () => import('../views/UpdateView.vue')
    },
    {
      path: '/delete',
      name: 'delete',
      component: () => import('../views/DeleteView.vue')
    },
    {
      path: '/post-blog',
      name: 'post-blog',
      component: () => import('../views/PostBlogView.vue')
    },
    {
      path: '/blog-list',
      name: 'blog-list',
      component: () => import('../views/BlogListView.vue')
    },
    {
      path: '/blog/:id',
      name: 'blog-detail',
      component: () => import('../views/BlogDetailView.vue'),
      props: true
    },
    {
      path: '/user-management',
      name: 'user-management',
      component: () => import('../views/UserManagementView.vue')
    }
  ],
})

export default router